import xml.dom.minidom
from xml.dom.minidom import Node

class Title:
	def __init__(self, node):
		self.parse(node)
	def parse(self, node):
		namelist = node.getElementsByTagName("title")[0].childNodes
		self.name = self.__getText(namelist)

		duration = node.getElementsByTagName("duration")[0].childNodes
		self.duration = self.__getText(duration)

		file = node.getElementsByTagName("location")[0].childNodes
		self.filename = self.__getText(file)
	def __getText(self, nodelist):
		for i in nodelist:
			lst = []
			if i.nodeType == i.TEXT_NODE:
				lst.append(i.data)
		return ''.join(lst)

